using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevComponents.DotNetBar;

namespace TznxStart
{
    public partial class BigDialog : DevComponents.DotNetBar.Office2007RibbonForm
    {
        public BigDialog()
        {
            InitializeComponent();
        }

        private void buttonX1_Click(object sender, EventArgs e)
        {
            System.Diagnostics.Process.Start(System.Configuration.ConfigurationManager.AppSettings["Caiji"].ToString());
        }
        private void buttonX2_Click(object sender, EventArgs e)
        {
            System.Diagnostics.Process.Start(System.Configuration.ConfigurationManager.AppSettings["BaoGao"].ToString());
        }

        private void buttonX1_MouseLeave(object sender, EventArgs e)
        {
            this.button21.BackgroundImage = global::TznxStart.Properties.Resources.button1_1;
            this.button21.Cursor = System.Windows.Forms.Cursors.Default;
        }

        private void buttonX1_MouseMove(object sender, MouseEventArgs e)
        {
            this.button21.BackgroundImage = global::TznxStart.Properties.Resources.button1_2;
            this.button21.Cursor = System.Windows.Forms.Cursors.Hand;
        }
        private void buttonX2_MouseLeave(object sender, EventArgs e)
        {
            this.button22.BackgroundImage = global::TznxStart.Properties.Resources.button2_1;
            this.button22.Cursor = System.Windows.Forms.Cursors.Default;
        }

        private void buttonX2_MouseMove(object sender, MouseEventArgs e)
        {
            this.button22.BackgroundImage = global::TznxStart.Properties.Resources.button2_2;
            this.button22.Cursor = System.Windows.Forms.Cursors.Hand;
        }

        private void BigDialog_Load(object sender, EventArgs e)
        {
            int intInitWidth = this.Width;
            int intHeight = this.Height;

            int intNewWidth = Screen.PrimaryScreen.Bounds.Width;
            int intNewHeight = Screen.PrimaryScreen.Bounds.Height;

            this.Width = intNewWidth;
            this.Height = intNewHeight;

            float wScale = (float)intNewWidth / (float)intInitWidth;
            float hScale = (float)intNewHeight / (float)intHeight;

            button21.Left = (int)Math.Ceiling(button21.Left * wScale);
            button21.Top = (int)Math.Ceiling(button21.Top * wScale);

            button22.Left = (int)Math.Ceiling(button22.Left * wScale);
            button22.Top = (int)Math.Ceiling(button22.Top * wScale);

            //this.TopMost = true;
            this.WindowState = FormWindowState.Maximized;
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;

            this.Hide();
            this.Show();

        }
    }
}